package org.shopen.puremvc.model.domain.theory
{
	import flash.text.StyleSheet;
	
	import org.shopen.puremvc.model.domain.ISerializable;
	
	public class Theory implements ISerializable
	{
		[Bindable]
		private var _meta : TheoryMeta = new TheoryMeta();
		[Bindable]
		public function get meta() : TheoryMeta
		{
			return _meta;
		}
		public function set meta(value : TheoryMeta) : void
		{
			_meta = value;
		}
		
		[Bindable]
		private var _htmlText : String = "";
		[Bindable]
		public function get htmlText() : String
		{
			return _htmlText;
		}
		public function set htmlText(value : String) : void
		{
			_htmlText = value;
		}
		
		[Bindable]
		private var _styleSheet : StyleSheet;
		[Bindable]
		public function get styleSheet() : StyleSheet
		{
			return _styleSheet;
		}
		public function set styleSheet(value : StyleSheet) : void
		{
			_styleSheet = value;
		}
		
		public function Theory(node : XML = null)
		{
			if (node != null)
			{
				deserialize(node);
			}
		}
		
		public function serialize() : XML
		{
			var resultNode : XML = <theory></theory>;
			resultNode = meta.serialize(resultNode);
			
			return resultNode;
		}
		
		public function deserialize(node : XML) : void
		{
			meta.deserialize(node);
		}
	}
}